//
//  UIDevice+LYAdd.h
//  LYDevelopKit
//
//  Created by 李阳 on 2018/5/25.
//

#import <UIKit/UIKit.h>

/// 设备类型
typedef NS_OPTIONS(NSUInteger, LYDeviceType)
{
    UnknownDevice         = 0,
    
    iPhone                = 0xFF, // 255
    iPhone4               = 1,
    iPhone4S              = 2,
    iPhone5               = 3,
    iPhone5C              = 4,
    iPhone5S              = 5,
    iPhone6               = 6,
    iPhone6Plus           = 7,
    iPhone6S              = 8,
    iPhone6SPlus          = 9,
    iPhone7               = 10,
    iPhone7Plus           = 11,
    iPhone8               = 12,
    iPhone8Plus           = 13,
    iPhoneX               = 14,
    iPhoneSE              = 15,
    
    iPad                  = 0xFF00, // 65280
    iPad1                 = 1 << 8,
    iPad2                 = (1 << 8) + 1,
    iPadMini              = (1 << 8) + 2,
    iPad3                 = (1 << 8) + 3,
    iPad4                 = (1 << 8) + 4,
    iPadAir               = (1 << 8) + 5,
    iPadMini2             = (1 << 8) + 6,
    iPadAir2              = (1 << 8) + 7,
    iPadMini3             = (1 << 8) + 8,
    iPadMini4             = (1 << 8) + 9,
    iPadPro12Dot9Inch     = (1 << 8) + 10,
    iPadPro9Dot7Inch      = (1 << 8) + 11,
    iPad5                 = (1 << 8) + 12,
    iPadPro12Dot9Inch2Gen = (1 << 8) + 13,
    iPadPro10Dot5Inch     = (1 << 8) + 14,
    
    iPod                  = 0xFF0000,
    iPodTouch1Gen         = (1 << 16),
    iPodTouch2Gen         = (1 << 16) + 1,
    iPodTouch3Gen         = (1 << 16) + 2,
    iPodTouch4Gen         = (1 << 16) + 3,
    iPodTouch5Gen         = (1 << 16) + 4,
    iPodTouch6Gen         = (1 << 16) + 5,
    
    Simulator             = 1 << 24
};

/// 设备尺寸
typedef NS_ENUM(NSInteger, LYDeviceSize)
{
    UnknownSize     = 0, ///< 未知大小
    Screen3Dot5inch = 1, ///< 3.5英寸
    Screen4inch     = 2, ///< 4英寸
    Screen4Dot7inch = 3, ///< 4.7英寸
    Screen5Dot5inch = 4, ///< 5.5英寸
    Screen5Dot8inch = 5 ///< 5.8英寸
};


@interface LYDevice : NSObject

/// 获取当前设备类型
+ (LYDeviceType)deviceType;
+ (BOOL)isIPhone;
+ (BOOL)isIPad;
+ (BOOL)isIPod;
+ (BOOL)isSimulator;


/// 设备绝对尺寸
+ (LYDeviceSize)resolutionSize;
/// 设备尺寸
+ (LYDeviceSize)deviceSize;

/// 设备是否处于缩放状态
+ (BOOL)isZoomed;


+ (BOOL)versionEqualTo:(NSString *)version;
+ (BOOL)versionGreaterThan:(NSString *)version;
+ (BOOL)versionGreaterThanOrEqualTo:(NSString *)version;
+ (BOOL)versionLessThan:(NSString *)version;
+ (BOOL)versionLessThanOrEqualTo:(NSString *)version;

@end

@interface UIDevice (LYAdd)

@end



